﻿//===============================================================================
// La Pomme d'Or Krystal Application
// Windows Presentation Foundation Composite Application 
//===============================================================================
// Copyright (c) Jérôme Piquot.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================

using System;
using System.ServiceModel;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using PJ.Business.SalePurchase;

namespace PJ.Operation.WCF
{
    [Serializable]
    [DataContract]
    public class CreateInvoiceResult : ICreateInvoiceResult
    {
        private string _Id;

        [DataMember]
        public string Id
        {
            get { return _Id; }
            set { _Id = value; }
        }

        private double _TotalAmount;

        [DataMember]
        public double TotalAmount
        {
            get { return _TotalAmount; }
            set { _TotalAmount = value; }
        }

        private byte[] _PdfDocument;

        [DataMember]
        public byte[] PdfDocument
        {
            get { return _PdfDocument; }
            set { _PdfDocument = value; }
        }

        public CreateInvoiceResult()
        {
        }
        public CreateInvoiceResult(ICreateInvoiceResult result)
        {
            _Id = result.Id;
            _PdfDocument = result.PdfDocument;
        }



    }


    /// <summary>
    /// <see cref="IObjectData">Object data</see> persistence provider interface
    /// </summary>
    /// <typeparam name="TIObjectData"><see cref="IObjectData">Object data</see> type</typeparam>
    [ServiceContract]
    public interface ISaleInvoiceWCFService
    {
        /// <summary>
        /// Gets the data object from the data source
        /// </summary>
        /// <param name="sessionId">User session id</param>
        /// <param name="globalId">Object global id</param>
        /// <param name="mode">Fetch mode</param>
        /// <returns>The data object</returns>
        /// <exception cref="ArgumentNullException"><paramref name="globalId"/> is <see langref="null"/> or empty</exception>
        /// <exception cref="DataNotFoundException">If the object with the specified GlobalId is not found and fetch mode is not Find</exception>
        [OperationContract]
        CreateInvoiceResult CreateSaleInvoice(string customerId, string reference, List<string> inventoryItemIds,
                                                List<double> quantities, List<string> units);

    }
}
